<template>
  <div class="user-card">
    <div class="icon-logo">
      <PreviewImg :src="nowRowData.doorHead"></PreviewImg>
      <div class="vr-btn fc" v-show="nowRowData.vr_src" @click="handleShowVR">
        VR
      </div>
    </div>
    <div class="user-info">
      <p class="f-between">
        <span>联系人：{{ nowRowData.personName }}</span>
        <span class="text-tag fc">{{ nowRowData.standardLabel }}</span>
      </p>
      <p>
        <span>联系电话：{{ nowRowData.personTelephone }}</span>
      </p>
      <p>
        <span>地址：{{ nowRowData.address }}</span>
      </p>
    </div>
    <AplidDialog
      style="
        --dialog-background: #fff;
        --dialog-header-background: rgba(253, 189, 0, 1);
      "
      width="75%"
      v-model="visible"
      :title="nowRowData.organizationName || nowRowData.soleValue"
    >
      <iframe
        v-if="visible"
        :src="nowRowData.vr_src"
        style="width: 100%; height: 60vh"
        frameborder="0"
      ></iframe>
    </AplidDialog>
  </div>
</template>

<script setup lang="ts">
const props = defineProps<{
  nowRowData?: any;
}>();

const visible = ref(false);

const handleShowVR = () => {
  visible.value = true;
};
</script>

<style scoped lang="scss">
.user-card {
  .icon-logo {
    width: calc(100% - 20px);
    height: 94.82px;
    margin: 10px;
    background-color: rgba(255, 255, 255, 0.709);
    position: relative;
    img {
      width: 100%;
      height: 100%;
    }
    .vr-btn {
      position: absolute;
      bottom: 0;
      left: 0;
      font-family: "Microsoft YaHei Bold";
      font-weight: 700;
      font-size: 14px;
      letter-spacing: 0.05px;
      line-height: 30px;
      color: #fff;
      text-shadow: 0 2px 3px rgba(0, 0, 0, 0.51);
      border-radius: 0 5px 0 0;
      background: #fdbd00;
      width: 31.07px;
      height: 19px;
      &:hover {
        cursor: pointer;
      }
    }
  }
  .user-info {
    padding: 10px;
    color: #fff;
    font-family: "Microsoft YaHei";
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.05px;
    text-align: left;
    line-height: 20px;
    .text-tag {
      background-color: rgba(253, 189, 0, 0.1);
      color: rgba(253, 189, 0, 1);
      border-radius: 2px;
      height: 19px;
      width: 39.07px;
      font-family: "Microsoft YaHei";
      font-weight: 400;
      font-size: 10px;
      letter-spacing: 0.05px;
    }
  }
}
</style>
